package com.hjm.common.utils.request;


/**
 * DES加密测试类
 * @author lixiaohe
 * @date 201709
 */
public class TestDesUtils {
	private static String commAuthDesKey = "KSagZxG3";
	/**
	 * DES解密
	 * @throws Exception
	 */
	public String desDecrypt(String key) {
		String value = "";
		try {
			value = CipherUtil.decryptData(key, commAuthDesKey).trim();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;
	}
	/**
	 * DES加密
	 * @throws Exception
	 */
	public static String desEncrypt(String key){
		String value = "";
		try {
			value = CipherUtil.encryptData(key, commAuthDesKey).trim();
		} catch (Exception e) {
			e.printStackTrace();
		}//DES解密后的卡号即明文卡号
		return value;
	}
	public static void main(String[] args) {
		System.out.println(desEncrypt("6225768755065628"));
	}
}
